/* 考试结果页面样式 */

/* CSS变量定义 */
:root {
    --result-primary-color: #1e88e5;
    --result-success-color: #4caf50;
    --result-warning-color: #ff9800;
    --result-danger-color: #f44336;
    --result-info-color: #2196f3;
    --result-text-color: #333;
    --result-text-muted: #666;
    --result-text-light: #999;
    --result-bg-color: #f5f5f5;
    --result-card-bg: #ffffff;
    --result-border-color: #e0e0e0;
    --result-shadow: 0 2px 4px rgba(0,0,0,0.1);
    --result-shadow-hover: 0 4px 8px rgba(0,0,0,0.15);
    --result-gradient-success: linear-gradient(135deg, #4caf50 0%, #81c784 100%);
    --result-gradient-warning: linear-gradient(135deg, #ff9800 0%, #ffb74d 100%);
    --result-gradient-danger: linear-gradient(135deg, #f44336 0%, #ef5350 100%);
}

/* 结果页面容器 */
.result-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--result-bg-color) 0%, #e8f4f8 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    position: relative;
    overflow-x: hidden;
}

/* 加载动画 */
.result-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.result-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--result-border-color);
    border-top: 4px solid var(--result-primary-color);
    border-radius: 50%;
    animation: resultSpin 1s linear infinite;
    margin-bottom: 20px;
}

.result-loading-text {
    color: var(--result-text-color);
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    text-align: center;
}

@keyframes resultSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 结果页面主体 */
.result-content {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* 结果头部 */
.result-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 40px 20px;
    background: var(--result-card-bg);
    border-radius: 12px;
    box-shadow: var(--result-shadow);
    position: relative;
    overflow: hidden;
}

.result-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--result-gradient-success);
}

.result-status-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
    position: relative;
    animation: resultPulse 2s ease-in-out infinite;
}

.result-status-icon.passed {
    background: var(--result-gradient-success);
}

.result-status-icon.failed {
    background: var(--result-gradient-danger);
}

.result-status-icon.pending {
    background: var(--result-gradient-warning);
}

@keyframes resultPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.result-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--result-text-color);
    margin: 0 0 10px 0;
}

.result-subtitle {
    font-size: 16px;
    color: var(--result-text-muted);
    margin: 0;
}

/* 成绩概览 */
.result-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-score-card {
    background: var(--result-card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--result-shadow);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-score-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--result-shadow-hover);
}

.result-score-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--result-primary-color);
}

.result-score-label {
    font-size: 14px;
    color: var(--result-text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-score-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--result-text-color);
    margin-bottom: 4px;
}

.result-score-value.score {
    color: var(--result-primary-color);
}

.result-score-value.passed {
    color: var(--result-success-color);
}

.result-score-value.failed {
    color: var(--result-danger-color);
}

.result-score-unit {
    font-size: 14px;
    color: var(--result-text-light);
}

/* 详细统计 */
.result-details {
    background: var(--result-card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--result-shadow);
    margin-bottom: 30px;
}

.result-details-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--result-text-color);
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--result-border-color);
}

.result-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.result-stat-item {
    text-align: center;
    padding: 16px;
    border: 1px solid var(--result-border-color);
    border-radius: 8px;
    background: #fafafa;
    transition: all 0.3s ease;
}

.result-stat-item:hover {
    background: #f0f0f0;
    border-color: var(--result-primary-color);
}

.result-stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--result-text-color);
    margin-bottom: 4px;
}

.result-stat-label {
    font-size: 12px;
    color: var(--result-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 题目分析 */
.result-analysis {
    background: var(--result-card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--result-shadow);
    margin-bottom: 30px;
}

.result-analysis-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--result-text-color);
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--result-border-color);
}

/* 新的题目结果项样式 */
.question-result-item {
    display: flex;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    margin-bottom: 16px;
    background: #fff;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.question-result-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* 题号样式 */
.question-result-number {
    width: 50px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    color: #fff;
    min-height: 80px;
    flex-shrink: 0;
}

.question-result-number.correct {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
}

.question-result-number.partial {
    background: linear-gradient(135deg, #ff9800, #ffb74d);
}

.question-result-number.incorrect {
    background: linear-gradient(135deg, #f44336, #e57373);
}

/* 内容区域样式 */
.question-result-content {
    flex: 1;
    padding: 16px 20px;
}

.question-result-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    line-height: 1.5;
}

.question-result-score {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
    padding: 4px 8px;
    background: #f5f5f5;
    border-radius: 4px;
    display: inline-block;
}

/* 答案区域样式 */
.question-result-answers {
    display: grid;
    gap: 12px;
}

.answer-section {
    border-radius: 6px;
    padding: 12px;
    border-left: 3px solid #ddd;
}

.answer-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
}

.user-answer {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    color: #333;
    border-left: 3px solid #6c757d;
    white-space: pre-wrap;
    word-break: break-word;
}

.correct-answer {
    background: #e8f5e8;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    color: #2e7d32;
    border-left: 3px solid #4caf50;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 状态区域样式 */
.question-result-status {
    width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 8px;
    background: #fafafa;
    border-left: 1px solid #e8e8e8;
}

.status-icon {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.status-icon-correct {
    color: #4caf50;
}

.status-icon-partial {
    color: #ff9800;
}

.status-icon-incorrect {
    color: #f44336;
}

.status-text {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    color: #666;
}

/* 操作按钮 */
.result-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.result-actions-container {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

.result-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.result-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.result-btn-primary {
    background: var(--result-primary-color);
    color: white;
}

.result-btn-primary:hover {
    background: #1976d2;
}

.result-btn-secondary {
    background: #6c757d;
    color: white;
}

.result-btn-secondary:hover {
    background: #545b62;
}

.result-btn-success {
    background: #28a745;
    color: white;
}

.result-btn-success:hover {
    background: #218838;
}

/* 无内容状态 */
.result-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--result-text-muted);
}

.result-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    opacity: 0.5;
}

.result-empty-text {
    font-size: 16px;
    margin-bottom: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .result-content {
        padding: 15px;
    }
    
    .result-header {
        padding: 30px 20px;
        margin-bottom: 20px;
    }
    
    .result-title {
        font-size: 24px;
    }
    
    .result-status-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .result-overview {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .result-score-value {
        font-size: 28px;
    }
    
    .result-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .result-actions-container {
        flex-direction: column;
        align-items: center;
    }
    
    .result-btn {
        width: 100%;
        max-width: 280px;
    }
    
    /* 题目项移动端样式 */
    .question-result-item {
        flex-direction: column;
    }
    
    .question-result-number {
        width: 100%;
        min-height: 60px;
        justify-content: flex-start;
        padding-left: 20px;
    }
    
    .question-result-status {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        border-left: none;
        border-top: 1px solid #e8e8e8;
    }
    
    .status-icon {
        margin-right: 8px;
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .result-content {
        padding: 10px;
    }
    
    .result-header {
        padding: 20px 15px;
    }
    
    .result-title {
        font-size: 20px;
    }
    
    .result-overview {
        grid-template-columns: 1fr;
    }
    
    .result-score-card,
    .result-details,
    .result-analysis {
        padding: 20px;
    }
    
    .question-result-item {
        flex-direction: column;
    }
    
    .question-result-number {
        width: 100%;
        min-height: 50px;
        justify-content: flex-start;
        padding-left: 15px;
        margin-right: 0;
    }
    
    .question-result-status {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        border-left: none;
        border-top: 1px solid #e8e8e8;
        padding: 12px 8px;
    }
    
    .status-icon {
        margin-right: 6px;
        margin-bottom: 0;
        font-size: 24px;
    }
    
    .result-actions-container {
        flex-direction: column;
        align-items: center;
    }
    
    .result-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* 打印样式 */
@media print {
    .result-wrapper {
        background: white !important;
    }
    
    .result-actions {
        display: none !important;
    }
    
    .result-loading {
        display: none !important;
    }
    
    .result-score-card,
    .result-details,
    .result-analysis {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

/* 无障碍支持 */
.result-wrapper *:focus {
    outline: 2px solid var(--result-primary-color);
    outline-offset: 2px;
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    :root {
        --result-text-color: #000;
        --result-text-muted: #333;
        --result-border-color: #000;
        --result-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }
    
    .result-btn {
        border: 2px solid currentColor;
    }
}

/* 动画偏好设置 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 成绩换算相关样式 ========== */

/* 成绩换算提醒框 */
.score-conversion-alert {
    margin-bottom: 20px !important;
    border-left: 4px solid var(--result-success-color) !important;
    background: linear-gradient(135deg, #f6ffed 0%, #ffffff 100%) !important;
}

.conversion-reminder {
    padding: 2px 0;
    font-size: 14px;
    line-height: 1.6;
}

.conversion-reminder strong {
    color: var(--result-success-color);
    font-weight: 600;
}

/* 换算后的成绩卡片 */
.result-score-card.converted {
    border: 2px solid var(--result-success-color) !important;
    background: linear-gradient(135deg, #f6ffed 0%, #ffffff 100%) !important;
    position: relative;
    overflow: visible;
}

.result-score-card.converted::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--result-gradient-success);
    border-radius: 8px;
    z-index: -1;
    opacity: 0.1;
}

/* 成绩换算标识 */
.score-badge {
    display: inline-block;
    background: var(--result-success-color);
    color: white;
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 5px;
    vertical-align: middle;
    box-shadow: 0 1px 2px rgba(76, 175, 80, 0.3);
    animation: scoreConversionPulse 2s ease-in-out infinite;
}

@keyframes scoreConversionPulse {
    0%, 100% {
        box-shadow: 0 1px 2px rgba(76, 175, 80, 0.3);
    }
    50% {
        box-shadow: 0 2px 4px rgba(76, 175, 80, 0.5);
    }
}

/* 原始成绩显示 */
.result-score-original {
    font-size: 12px;
    color: var(--result-text-muted);
    margin-top: 5px;
    line-height: 1.3;
    opacity: 0.8;
}

.result-score-original small {
    font-size: 11px;
}

/* 换算说明文本 */
.result-score-note {
    font-size: 11px;
    color: var(--result-text-light);
    margin-top: 3px;
    line-height: 1.2;
    font-style: italic;
}

.text-muted {
    color: var(--result-text-muted) !important;
}

/* 换算后的成绩数值强调 */
.score.converted {
    color: var(--result-success-color) !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(76, 175, 80, 0.2);
}

/* 响应式设计 - 移动端适配 */
@media (max-width: 768px) {
    .score-badge {
        font-size: 8px;
        padding: 1px 4px;
        margin-left: 3px;
    }
    
    .result-score-original {
        font-size: 10px;
        margin-top: 3px;
    }
    
    .result-score-note {
        font-size: 9px;
        margin-top: 2px;
    }
    
    .conversion-reminder {
        font-size: 12px;
        padding: 0;
    }
    
    .conversion-reminder strong {
        font-size: 13px;
    }
}

/* 高对比度支持 */
@media (prefers-contrast: high) {
    .result-score-card.converted {
        border: 3px solid var(--result-success-color) !important;
        background: #ffffff !important;
    }
    
    .score-badge {
        background: #000 !important;
        color: #fff !important;
        border: 1px solid var(--result-success-color);
    }
    
    .score.converted {
        color: #000 !important;
        text-decoration: underline;
    }
}

/* 打印样式适配 */
@media print {
    .score-conversion-alert {
        border: 2px solid #000 !important;
        background: #f9f9f9 !important;
        break-inside: avoid;
    }
    
    .result-score-card.converted {
        border: 2px solid #000 !important;
        background: #f9f9f9 !important;
    }
    
    .score-badge {
        background: #000 !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .conversion-reminder {
        page-break-inside: avoid;
    }
}

/* 无障碍访问增强 */
.score-badge[aria-label] {
    position: relative;
}

.score-badge:focus {
    outline: 2px solid var(--result-primary-color);
    outline-offset: 1px;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .score-conversion-alert {
        background: linear-gradient(135deg, #1a3e1a 0%, #2d2d2d 100%) !important;
        border-left-color: #4caf50 !important;
    }
    
    .result-score-card.converted {
        background: linear-gradient(135deg, #1a3e1a 0%, #2d2d2d 100%) !important;
        border-color: #4caf50 !important;
    }
    
    .conversion-reminder {
        color: #e0e0e0;
    }
    
    .conversion-reminder strong {
        color: #81c784;
    }
    
    .result-score-original {
        color: #b0b0b0;
    }
    
    .result-score-note {
        color: #888;
    }
} 